package com.gc.server.service;

import com.gc.server.entity.ActRecordEntity;
import com.gc.server.entity.GoodsRecordEntity;
import com.gc.server.entity.TodoEntity;
import com.gc.server.vo.ToDoSumVo;
import com.gc.server.vo.TodoVo;
import com.yf.service.BaseService;

import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;

/**
 * 日程Service接口
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Tue Mar 10 11:17:45 CST 2020
 */
public interface TodoService extends BaseService<TodoEntity> {



     List<TodoVo> queryListVo(TodoVo todoVo);

     TodoVo getVo(Long id);

    /***********BACK***********/

    /***********API***********/
    /**
     * 新增一个日程
     *
     * @param planId
     * @param date
     * @param type
     * @param userId
     * @param school
     * @param title
     * @return
     */
    void add(Long planId, Date date, Integer type, Long userId, String[] titles);

    /**
     * 删除日程
     * @param userId
     * @param id
     */
    void del(Long userId,Long id);

    void del(Long userId,Date date,Integer type);

    /**
     * 完善拜访药店日程
     *
     * @param todoId
     * @param address
     * @param priceImg
     * @param displayImg
     * @param airImg
     * @param chat
     * @param summary
     * @param goodsRecordEntities
     * @return
     */
    TodoEntity completeVisit(TodoEntity todoEntity, Long userId,Long[] ids, Integer[] nums);

    /**
     * 完善试用装发放
     * @param totoId
     * @param address
     * @param school
     * @param audio
     * @param sendNum
     * @param sendImg
     * @return
     */
    TodoEntity completeSend(TodoEntity todoEntity,Long userId);

    /**
     * 完善药店活动
     * @param totoId
     * @param actName
     * @param selNum
     * @param userNum
     * @param summary
     * @param actRecords
     * @param goodsRecords
     * @return
     */
    TodoEntity completeAct(TodoEntity todoEntity,Long userId,Long[] ids,Integer[] nums);

    /**
     * 找出周计划的所有日程
     * @param planId
     * @return
     */
    List<TodoEntity> findByPlanId(Long planId);

    List<TodoEntity> findByDateAndUserId(Long userId,Date startDate,Date endDate);


    /**
     * 找出下面团队的日程
     * @param pid
     * @param userId
     * @param date
     * @return
     */
    List<TodoEntity> findMyShopUserUser(Long pid,Long userId,Date date);

    List<TodoVo> findVoByTopUser(Long pid,Date date);

    /**
     * 下载并且统计
     * @param todoVo
     */
    void downLoad(HttpServletResponse response, List<TodoVo> list);


    List<TodoEntity> findByDateAndUserIdAndTopUserId(Long userId, Date startDate, Date endDate, Long topUserId);

    List<ToDoSumVo> sumByDate(Long userId,Date startDate , Date endDate);

    Integer sumCheck(Long userId);

    void completeHunt(TodoEntity todoEntity, Long userId);


    void completeOther(TodoEntity todoEntity,Long userId);
}
